<template>
    <div class="container">
      <div class="betterScroll">
        <div class="betterScroll--box">
          <div class="container--item" v-for="(item, key) in paidData" :key="key">
            <p class="container--item__title">
              <span class="container--title__left">订单状态</span>
              <span class="container--title__right">已完成</span>
            </p>
            <div class="container--item__commodityMsg">
              <div class="container--commodityMsg__left">
                <img :src="item.carts[0].prod.prodImage[0]" alt="#">
              </div>
              <span class="container--item__prodSubTitle">{{item.carts[0].prod.prodSubTitle}}</span>
              <span class="container--item__currentPrice">
                ￥{{item.carts[0].prod.currentPrice}}
              </span>
              <span class="container--item__num">X1</span>
            </div>
          </div>
        </div>
      </div>
    </div>
</template>

<script>
/* eslint-disable*/
  export default {
    name: "Completed",
    data() {
      return {
        paidData: [],
        betterScroll: null,
      }
    },
    mounted() {
      this.betterScroll = new this.$Bs('.betterScroll', {
        scrollX: false,
        scrollY: true,
        click: true
      })
    },
    created() {
      this.$api.queryOrder({ payStatus: 1 })
        .then(data => {
          console.log(data);
          if (data.data.code === 1) {
            this.$store.commit('assignmentPaid', data.data.data);
            this.paidData = this.$store.state.Paid;
          }
        });
    },
  }
</script>

<style scoped lang="scss">
  *{
    margin: 0;
    padding: 0;
    font-size: 0;
  }
  .container{
    display: inline-block;
    width: 100vw;
    vertical-align: top;
    background-color: #f5f5f5;
    .betterScroll{
      width: 100vw;
      height: 86vh;
      overflow: hidden;
      .betterScroll--box{
        .container--item{
          background-color: #9a6e3a;
          width: 100vw;
          height: (227/75) + rem;
          margin-bottom: (20/75) + rem;
          .container--item__title{
            position: relative;
            width: 100vw;
            line-height: (67/75) + rem;
            border-bottom: 1px solid #ccc;
            background-color: #fff;
            span{
              font-size: .35rem;
            }
            .container--title__left{
              margin-left: .35rem;
            }
            .container--title__right{
              position: absolute;
              right: .35rem;
              color: #f0738c;
            }
          }
          .container--item__commodityMsg{
            position: relative;
            width: 100vw;
            height: (228-67)/75 + rem;
            background-color: #fafafa;
            span{
              font-size: .35rem;
              color: #636363;
            }
            .container--commodityMsg__left{
              display: inline-block;
              width: (107/75) + rem;
              height: (107/75) + rem;
              margin-left: .35rem;
              margin-top: .35rem;
              img{
                width: 100%;
                height: 100%;
              }
            }
            .container--item__prodSubTitle{
              position: absolute;
              left: 2rem;
              top: .5rem;
            }
            .container--item__currentPrice{
              margin-left: .16rem;
            }
            .container--item__num{
              position: absolute;
              right: .35rem;
              top: 1.5rem;
            }
          }
        }
      }

    }

  }
</style>
